<style >
    .login{
        width: 400px;
        margin: auto ;
        height: 220px;
        font-family: inherit;
        background-color: #fff ;
    }
    .thuy{
        width: 400px;
        height: 200px;
    }
    .login_tr1{
        background-color:#2882bc;
        height: 40px;
    }
    .login_td1{
        color: #fff ;  
        font-size: 18px;
        font-weight: bold; 
        padding-left: 20px;
    }
    .smit_login{
        margin-top: 20px;
        width: 100px;
        background-color: #5dade2;
        color: #fff;
        height: 36px;
        font-size: 15px;
        font-weight: bold;
    }
</style>
<div class="login">
    <table class="thuy" cellspacing="0" >
        <tr class="login_tr1">
            <td class="login_td1">Đăng Nhập</td>
        </tr>
        <tr >
            <td>
                <div style="margin-left: 50px;width: 300px;">
                    <form method="post">
                    <div style="height: 20px;font-size: 15px;">Tên Đăng Nhập</div>
                    <div ><input type="text" name="username" style="width: 100%;height: 30px;padding-left: 20px"/></div>
                    <div style="height: 20px;font-size: 15px;">Mật Khẩu</div>
                    <div ><input type="password" name="password" style="width: 100%;height: 30px;padding-left: 20px" /></div>
                    <div ><input type="submit" value="Đăng Nhập" name="smit" class="smit_login"/></div>
                    </form>
                </div>
            </td>
        </tr>
    </table>
</div>
<?php
if (isset($_POST['username'])) {
    $result = mysql_query("select * from nguoi_dung where USERNAME='" . $_POST['username'] . "'");
    $row = mysql_num_rows($result);
    if (mysql_num_rows($result) >= 1) {
        $row = mysql_fetch_array($result);
        $_SESSION['user'] = $row['USERNAME'];
        ?>
        <script > window.location.href = "index.php";</script>
        <?php
        $_SESSION['quyen'] = $row['Quyen'];
    }
}
?>